package com.example.phone.account.activity;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.phone.R;
import com.example.phone.base.BaseActivity;
import com.example.phone.base.MyApp;
import com.example.phone.base.RequestInterface;
import com.example.phone.bean.User;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import de.hdodenhof.circleimageview.CircleImageView;

public class PersonInfomationActivity extends BaseActivity {


    @BindView(R.id.ci_head_portrait)
    CircleImageView ciHeadPortrait;
    @BindView(R.id.user_name)
    TextView userName;
    @BindView(R.id.mail_box)
    TextView mailBox;
    @BindView(R.id.mobile)
    TextView mobile;

    User user;
    @BindView(R.id.iv_go_back)
    ImageView ivGoBack;

    @Override
    public void initData() {

    }

    @Override
    public void initView() {
        ButterKnife.bind(this);
        MyApp app = (MyApp) getApplication();
        user = app.getUser();

        //设置页面数据
        userName.setText(user.getUsername());
        mobile.setText(user.getPhone());
        mailBox.setText(user.getEmail());
        Glide.with(this)
                .load(RequestInterface.baseImgPath + user.getHeadPortraitUrl())
                .into(ciHeadPortrait);
    }

    @Override
    public int initLayout() {
        return R.layout.activity_person_infomation;
    }



    @OnClick(R.id.iv_go_back)
    public void onViewClicked() {
        goNextActivity(TestActivity.class);
        finish();
    }
}
